package handlers

import (
	"net/http"
	"time"

	"filehive-backend/utils"
)

// RootHandler 根路径处理器
func RootHandler(w http.ResponseWriter, r *http.Request) {
	utils.RespondJSON(w, http.StatusOK, map[string]interface{}{
		"name":         "FileHive API 服务器 (Go版本)",
		"version":      "1.0.0",
		"message":      "🚀 FileHive Go后端API服务运行正常",
		"description":  "这是FileHive文件共享系统的Go版本后端API服务器",
		"frontend_url": "http://localhost:5173",
		"api_endpoints": map[string]string{
			"files":    "GET /api/files?path=<路径> - 获取文件列表",
			"upload":   "POST /api/upload - 上传文件",
			"download": "GET /api/download?path=<路径> - 下载文件",
			"folder":   "POST /api/folder - 创建文件夹",
			"delete":   "DELETE /api/files - 删除文件",
			"move":     "PUT /api/move - 移动/重命名文件",
			"info":     "GET /api/info?path=<路径> - 获取文件信息",
		},
		"notice":       "📌 要使用文件共享功能，请访问前端服务: http://localhost:5173",
		"status":       "running",
		"timestamp":    time.Now().Format(time.RFC3339),
		"architecture": "go-modular",
	})
} 